\documentclass[landscape]{article}
\thispagestyle{empty}
\usepackage{amsmath,amssymb}
\usepackage{wasysym}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usepackage{pgfplots}
\usepackage[margin=0cm]{geometry}
   % Workaround for making use of externalization possible
   % -> remove hardcoded pdflatex and replace by lualatex
%    \usepgfplotslibrary{external}
%        \tikzset{external/system call={lualatex \tikzexternalcheckshellescape%
%         -halt-on-error -interaction=batchmode -jobname "\image" "\texsource"}}

% Redefine rotation sequence for tikz3d-plot to z-y-x
\newcommand{\tdseteulerxyz}{
\renewcommand{\tdplotcalctransformrotmain}{%
%perform some trig for the Euler transformation
\tdplotsinandcos{\sinalpha}{\cosalpha}{\tdplotalpha} 
\tdplotsinandcos{\sinbeta}{\cosbeta}{\tdplotbeta}
\tdplotsinandcos{\singamma}{\cosgamma}{\tdplotgamma}
%
\tdplotmult{\sasb}{\sinalpha}{\sinbeta}
\tdplotmult{\sasg}{\sinalpha}{\singamma}
\tdplotmult{\sasbsg}{\sasb}{\singamma}
%
\tdplotmult{\sacb}{\sinalpha}{\cosbeta}
\tdplotmult{\sacg}{\sinalpha}{\cosgamma}
\tdplotmult{\sasbcg}{\sasb}{\cosgamma}
%
\tdplotmult{\casb}{\cosalpha}{\sinbeta}
\tdplotmult{\cacb}{\cosalpha}{\cosbeta}
\tdplotmult{\cacg}{\cosalpha}{\cosgamma}
\tdplotmult{\casg}{\cosalpha}{\singamma}
%
\tdplotmult{\cbsg}{\cosbeta}{\singamma}
\tdplotmult{\cbcg}{\cosbeta}{\cosgamma}
%
\tdplotmult{\casbsg}{\casb}{\singamma}
\tdplotmult{\casbcg}{\casb}{\cosgamma}

\tdplotmult{\casbcg}{\casb}{\cosgamma}
%
%determine rotation matrix elements for Euler transformation
\pgfmathsetmacro{\raaeul}{\cbcg}
\pgfmathsetmacro{\rabeul}{-\cbsg}
\pgfmathsetmacro{\raceul}{\sinbeta }
\pgfmathsetmacro{\rbaeul}{\casg + \sasbcg}
\pgfmathsetmacro{\rbbeul}{\cacg - \sasbsg}
\pgfmathsetmacro{\rbceul}{-\sacb}
\pgfmathsetmacro{\rcaeul}{\sasg - \casbcg}
\pgfmathsetmacro{\rcbeul}{\sacg + \casbsg}
\pgfmathsetmacro{\rcceul}{\cacb}
}

% 
% \renewcommand{\tdplotcalctransformmainrot}{%
% %perform some trig for the Euler transformation
% \tdplotsinandcos{\sinalpha}{\cosalpha}{\tdplotalpha} 
% \tdplotsinandcos{\sinbeta}{\cosbeta}{\tdplotbeta}
% \tdplotsinandcos{\singamma}{\cosgamma}{\tdplotgamma}
% %
% \tdplotmult{\sasb}{\sinalpha}{\sinbeta}
% \tdplotmult{\sasg}{\sinalpha}{\singamma}
% \tdplotmult{\sasbsg}{\sasb}{\singamma}
% %
% \tdplotmult{\sacb}{\sinalpha}{\cosbeta}
% \tdplotmult{\sacg}{\sinalpha}{\cosgamma}
% \tdplotmult{\sasbcg}{\sasb}{\cosgamma}
% %
% \tdplotmult{\casb}{\cosalpha}{\sinbeta}
% \tdplotmult{\cacb}{\cosalpha}{\cosbeta}
% \tdplotmult{\cacg}{\cosalpha}{\cosgamma}
% \tdplotmult{\casg}{\cosalpha}{\singamma}
% %
% \tdplotmult{\cbsg}{\cosbeta}{\singamma}
% \tdplotmult{\cbcg}{\cosbeta}{\cosgamma}
% %
% \tdplotmult{\casbsg}{\casb}{\singamma}
% \tdplotmult{\casbcg}{\casb}{\cosgamma}
% 
% \tdplotmult{\casbcg}{\casb}{\cosgamma}
% %
% %determine rotation matrix elements for Euler transformation
% \pgfmathsetmacro{\raaeul}{\cbcg}
% \pgfmathsetmacro{\rabeul}{\casg + \sasbcg}
% \pgfmathsetmacro{\raceul}{\sasg - \casbcg }
% \pgfmathsetmacro{\rbaeul}{-\cbsg}
% \pgfmathsetmacro{\rbbeul}{\cacg - \sasbsg}
% \pgfmathsetmacro{\rbceul}{\sacg+\casbsg}
% \pgfmathsetmacro{\rcaeul}{\sinbeta}
% \pgfmathsetmacro{\rcbeul}{-\sacb}
% \pgfmathsetmacro{\rcceul}{\cacb}
% }
}

\tdseteulerxyz

\usepackage{siunitx}
 \input{../styles/def}

%%%%%%%%% Z
\begin{document}
\clearpage
\centering



% Set the plot display orientation
% Syntax: \tdplotsetdisplay{\theta_d}{\phi_d}

 \tdplotsetmaincoords{60}{120}
%\tdplotsetmaincoords{60}{140}

\pgfmathsetmacro{\xRot}{50}
\pgfmathsetmacro{\yRot}{25}
\pgfmathsetmacro{\zRot}{30}

% Start tikz picture, and use the tdplot_main_coords style to implement the display 
% coordinate transformation provided by 3dplot.
\begin{tikzpicture}[scale=1.5,tdplot_main_coords,baseline=(current bounding box.north)]

% Set origin of main (body) coordinate system
\coordinate (O) at (0,0,0);
\node[draw=none] at (0.5,-0.8,1) {1)};
% Draw main coordinate system
\draw[black, ,->] (0,0,0) -- (1,0,0) node[anchor=south east]{$e_x^{A}$, \textcolor{red}{$e_{x'}^B$}};
\draw[black, ,->] (0,0,0) -- (0,1,0) node[anchor= west]{$e_y^{A}$};
\draw[black, ,->] (0,0,0) -- (0,0,1) node[anchor=west]{$e_z^{A}$}; 



% Intermediate frame 1
\tdplotsetrotatedcoords{\xRot}{0}{0}
\draw[thick,tdplot_rotated_coords,->, red] (0,0,0) -- (1,0,0) node[anchor=west]{};
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (0,1,0) node[anchor=west]{$e_{y'}^B$};
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (0,0,1) node[anchor=west]{$e_{z'}^B$};

\tdplotsetrotatedcoords{0}{90}{0}
\tdplotdrawarc[thick,tdplot_rotated_coords,->,color=gray]{(0,0,0)}{.5}{180}{180+\xRot}{anchor=south,color=gray}{$x$}

\end{tikzpicture}
%%%%%%%%%%%%%%%%% Z-Y
\begin{tikzpicture}[scale=1.5,tdplot_main_coords,font=\small,baseline=(current bounding box.north)] 
        thick,
% Set origin of main (body) coordinate system
\coordinate (O) at (0,0,0);
\node[draw=none] at (0.5,-0.8,1) {2)};
% Draw main coordinate system
\draw[black, ,->] (0,0,0) -- (1,0,0) node[anchor=south east]{$e_x^{A}$, \textcolor{red}{$e_{x'}^B$}};
\draw[black, ,->] (0,0,0) -- (0,1,0) node[anchor= west]{$e_y^{A}$};
\draw[black, ,->] (0,0,0) -- (0,0,1) node[anchor=west]{$e_z^{A}$}; 

% Intermediate frame 1
\tdplotsetrotatedcoords{\xRot}{0}{0}
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (1,0,0) node[anchor=west]{};
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (0,1,0) node[anchor=west]{{$e_{y'}^B$}, \textcolor{green!50!black}{$e_{y''}^C$} };
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (0,0,1) node[anchor=west]{$e_{z'}^B$};

\tdplotsetrotatedthetaplanecoords{0}
\tdplotdrawarc[thick,tdplot_rotated_coords,->,color=gray]{(0,0,0)}{0.5}{90}{90+\yRot}{anchor=north east,color=gray}{$y$}


\tdplotsetrotatedcoords{0}{90}{0}
\tdplotdrawarc[thick,tdplot_rotated_coords,->,color=gray]{(0,0,0)}{.5}{180}{180+\xRot}{anchor=south,color=gray}{$x$}

\tdplotsetrotatedcoords{0}{0}{0}
% Intermediate frame 2
\tdplotsetrotatedcoords{\xRot}{\yRot}{0}
\draw[tdplot_rotated_coords,->, green!50!black] (0,0,0) -- (1,0,0)
node[anchor=west ]{$e_{x''}^C$};
\draw[thick,tdplot_rotated_coords,->, green!50!black] (0,0,0) -- (0,1,0)
node[anchor=south west]{};
\draw[tdplot_rotated_coords,->, green!50!black] (0,0,0) -- (0,0,1)
node[anchor=north ]{$e_{z''}^C$};




\end{tikzpicture}
%%%%%%%%%%%%% Z-Y-X
\begin{tikzpicture}[scale=1.5,tdplot_main_coords,baseline=(current bounding box.north)]
\node(rectangle) at (0,6,1.6){$\tiny\begin{aligned}
\vC_{A\!D} &= {\color{red}\vC_{A\!B}} {\color{green!50!black}\vC_{B\!C}} {\color{blue}\vC_{C\!D}} \quad \Rightarrow \quad _{A}\vr = \vC_{A\!D} {}_{D}\vr \\
&= {\color{red}\begin{pmatrix} 
1 & 0 & 0 \\ 
0 & \cos{z} & -\sin{x} \\ 
0 & \sin{x} & \cos{x} \\
\end{pmatrix}} 
{\color{green!50!black}\begin{pmatrix} 
\cos{y} & 0 & \sin{y} \\ 
0 & 1 & 0 \\ 
-\sin{y} & 0 & \cos{y} 
\end{pmatrix}}
{\color{blue}\begin{pmatrix} 
\cos{z} & -\sin{z} & 0 \\ 
\sin{z} & \cos{z} & 0 \\ 
0 & 0 & 1 \\
\end{pmatrix}} \\
&= \begin{pmatrix}
\cos(y)\cos(z)	&	-\cos(y)\sin(z)	&	\sin(y) \\
\cos(x)\sin(z)+\cos(z)\sin(x)\sin(y)	&	\cos(x)\cos(z)-\sin(x)\sin(y)\sin(z)	&	-\cos(y)\sin(x) \\
\sin(x)\sin(z)-\cos(x)\cos(z)\sin(y)	&	\cos(z)\sin(x)+\cos(x)\sin(y)\sin(z)	&	\cos(x)\cos(y) \\
\end{pmatrix} 
\end{aligned}$};
% Set origin of main (body) coordinate system
\coordinate (O) at (0,0,0);
\node[draw=none] at (0.5,-0.8,1) {3)};

% Draw main coordinate system
\draw[black, ,->] (0,0,0) -- (1,0,0) node[anchor=south east]{$e_x^{A}$, \textcolor{red}{$e_{x'}^B$}};
\draw[black, ,->] (0,0,0) -- (0,1,0) node[anchor= west]{$e_y^{A}$};
\draw[black, ,->] (0,0,0) -- (0,0,1) node[anchor=west]{$e_z^{A}$}; 



% Intermediate frame 1
\tdplotsetrotatedcoords{\xRot}{0}{0}
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (1,0,0) node[anchor=west]{};
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (0,1,0) node[anchor=north west]{{$e_{y'}^B$}, \textcolor{green!50!black}{$e_{y''}^C$}};
\draw[tdplot_rotated_coords,->, red] (0,0,0) -- (0,0,1) node[anchor=west]{$e_{z'}^B$};

\tdplotsetrotatedthetaplanecoords{0}
\tdplotdrawarc[thick,tdplot_rotated_coords,->,color=gray]{(0,0,0)}{0.5}{90}{90+\yRot}{anchor=north east,color=gray}{$y$}

\tdplotsetrotatedcoords{0}{90}{0}
\tdplotdrawarc[thick,tdplot_rotated_coords,->,color=gray]{(0,0,0)}{.5}{180}{180+\xRot}{anchor=south,color=gray}{$x$}

% Intermediate frame 2
\tdplotsetrotatedcoords{0}{0}{0}
% Intermediate frame 2
\tdplotsetrotatedcoords{\xRot}{\yRot}{0}
\draw[tdplot_rotated_coords,->, green!50!black] (0,0,0) -- (1,0,0)
node[anchor=west ]{$e_{x''}^C$};
\draw[tdplot_rotated_coords,->, green!50!black] (0,0,0) -- (0,1,0)
node[anchor=south]{};
\draw[tdplot_rotated_coords,->, green!50!black] (0,0,0) -- (0,0,1)
node[anchor=north east]{$e_{z''}^C$, \textcolor{blue}{$e_{z'''}^D$}};

%\tdplotsetrotatedcoords{\zRot}{\yRot+90}{0}
\tdplotdrawarc[thick,tdplot_rotated_coords,->,color=gray]{(0,0,0)}{0.5}{90}{90+\zRot}{anchor=north west,color=gray}{$z$}

\tdplotsetrotatedcoords{0}{0}{0}
% Rotate to final frame
\tdplotsetrotatedcoords{\xRot}{\yRot}{\zRot}
\draw[tdplot_rotated_coords,->, blue] (0,0,0) -- (1,0,0)
node[anchor=west]{$e_{x'''}^D$};
\draw[tdplot_rotated_coords,->, blue] (0,0,0) -- (0,1,0) node[anchor=west ]{$e_{y'''}^D$};
\draw[thick,tdplot_rotated_coords,->, blue] (0,0,0) -- (0,0,1) node[anchor=north east]{};






\end{tikzpicture}


\end{document}
